﻿using Pattern24解释器模式.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pattern24解释器模式.Models
{
    /// <summary>
    /// 非终结符表达式
    /// </summary>
    public class NonTerminalExpression : Expression
    {
        private Expression left, right;
        public NonTerminalExpression(Expression left, Expression right)
        {
            this.left = left;
            this.right = right;
        }

        public override string Interpret()
        {
            return $"{left.Interpret()} 然后 {right.Interpret()}";
        }
    }
}
